/*
 * @Author: chenyunye C18025010782@163.com
 * @Date: 2023-03-14 19:23:25
 * @LastEditors: chenyunye C18025010782@163.com
 * @LastEditTime: 2023-03-16 15:06:37
 * @FilePath: \web\src\axios\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from "axios";

const instance = axios.create({
  // baseURL: '/api/v1', // 开发模式下
  baseURL: "http://114.116.237.240:3000/api/v1", // 线上模式
  // baseURL: 'http://localhost:3000/api/v1',
  // 请求超时时间
  timeout: 10000,
});

instance.interceptors.request.use((config) => {
  // console.log(config)
  config.headers.Authorization =
    "Bearer " + window.sessionStorage.getItem("token");
  return config;
});

export default instance;
